require.config({
  baseUrl: '/static/js/third-party',
  paths: {
    //----third-party
    "crypto": "crypto-js.min",
    "jquery": "jquery-3.5.1.min",
    "jstree": "jstree.min",
    "xterm": "xterm",

    //----page
    "index": "../page/index",
    "sftp": "../page/sftp",

    //----mylib
    "webshell": "../mylib/web-shell",
    "websocket": "../mylib/web-socket",
  },
  shim: {
    //
  }
});

require(["jquery"],function($){
    var currentPage = $('#current-page').attr("current-page");
    var targetModule = $('#current-page').attr("target-module");
    switch (targetModule){
      case 'index':
        require(["index"],function (index){
          new index( $('#container') ).init();
        });
        break;
      case 'sftp':
        require(["sftp"],function (sftp){
          sftp( $('#container') )();
        })
    }
})
